#include "StdAfx.h"
#include "BaseMessage.h"

CBaseMessage::CBaseMessage(DWORD type)
{	
	
}

CBaseMessage::~CBaseMessage(void)
{
}
void CBaseMessage::SetType(DWORD dwType)
{
	m_dwType=dwType;
	m_Data.AddData((BYTE*)&dwType,sizeof(DWORD));
}

void CBaseMessage::Add(char* str)
{
	//m_DataBlock.AddData((BYTE*)str,strlen(str));
	m_Data.AddData((BYTE*)str,strlen(str));
}

void CBaseMessage::Add(long Val)
{
	//m_DataBlock.AddData((BYTE*)&Val,sizeof(long));
	m_Data.AddData((BYTE*)&Val,sizeof(long));
}

void CBaseMessage::Add(BYTE Val)
{
	//m_DataBlock.AddData((BYTE*)&Val,sizeof(BYTE));
	m_Data.AddData((BYTE*)&Val,sizeof(BYTE));
}

DWORD CBaseMessage::GetDWORD()
{
	DWORD dwVal;
	//m_DataBlock.GetData((BYTE*)&dwVal,sizeof(DWORD));
	m_Data.GetData((BYTE*)&dwVal,sizeof(DWORD));
	return dwVal;
}

void CBaseMessage::GetStr(char* buffer,DWORD dwsize)
{
	//m_DataBlock.GetData((BYTE*)buffer,dwsize);
	m_Data.GetData((BYTE*)buffer,dwsize);
}

void CBaseMessage::SetData(BYTE* buffer,DWORD dwSize)
{
	m_Data.AddData(buffer,dwSize);
}

void CBaseMessage::Send()    
{

}